package com.filetransfer.demo;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.PreparedStatement;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;


//实验性的测试文件，有些函数不知道具体效果，在此测试

public class test {
    @Autowired
    private static JdbcTemplate jdbcTemplate;

    public static void main(String[] args) throws IOException {
        //uuid
//        String uuid = UUID.randomUUID().toString();
//        SimpleDateFormat formatter= new SimpleDateFormat("yyyyMMdd");
//        Date date = new Date();
//        System.out.println(formatter.format(date));
//        String dir = "/User/eric/code/test";
//
//        System.out.println(dir)
//        jdbcTemplate.execute("select * form fileServer;");

        String dir = "/Users/eric/code/test/20211116/99c2604d-00b9-46ed-971c-171f5a0af837";
        FileInputStream fileInputStream = new FileInputStream(dir);
        byte[] bytes = fileInputStream.readAllBytes();
        Server.writeFile("/Users/eric/code/test/test.txt",bytes);

    }


}
